Support 64-bit integers in acorn passes - #24283
Merged
Merged
Conversation
kripken
approved these changes
May 8, 2025
|
|
||
| HeAp[x]; | ||
|
|
||
| // but not this |
Member
There was a problem hiding this comment.
Please move this comment in the test so it is before the code, which should make it remain in the right place, I hope.
RReverser
enabled auto-merge (squash)
May 8, 2025 18:51
kripken
approved these changes
May 8, 2025
RReverser
added a commit
to RReverser/emscripten
that referenced
this pull request
May 9, 2025
This streamlines the `SAFE_HEAP` transform in acorn-optimizer. I was going to send this as a separate cleanup PR as part of my other work on acorn-optimizer, but it happens to also be the easy fix for a regression mentioned in emscripten-core#24289 and caused by emscripten-core#24283 which added support for 64-bit integers to acorn-optimizer passes. I could fix that issue separately by tweaking `unSign`, but this way we don't need to bother - the values with correct sign are now automatically retrieved by accessing the correct `HEAP*` array. I've added a regression test for the linked issue as well, which fails before this PR and passes after.
RReverser
added a commit
to RReverser/emscripten
that referenced
this pull request
May 9, 2025
This streamlines the `SAFE_HEAP` transform in acorn-optimizer. I was going to send this as a separate cleanup PR as part of my other work on acorn-optimizer, but it happens to also be the easy fix for a regression mentioned in emscripten-core#24289 and caused by emscripten-core#24283 which added support for 64-bit integers to acorn-optimizer passes. I could fix that issue separately by tweaking `unSign`, but this way we don't need to bother - the values with correct sign are now automatically retrieved by accessing the correct `HEAP*` array. I've added a regression test for the linked issue as well, which fails before this PR and passes after.
Collaborator
|
This has caused |
Collaborator
Author
|
Yes, that's the failure it refers to in the PR description. |
RReverser
added a commit
that referenced
this pull request
May 13, 2025
This streamlines the `SAFE_HEAP` transform in acorn-optimizer. I was going to send this as a separate cleanup PR as part of my other work on acorn-optimizer, but it happens to also be the easy fix for a regression mentioned in #24289 and caused by #24283 which added support for 64-bit integers to acorn-optimizer passes. I could fix that issue separately by tweaking `unSign`, but this way we don't need to bother - the values with correct sign are now automatically retrieved by accessing the correct `HEAP*` array. I've added a regression test for the linked issue as well, which fails before this PR and passes after.
juj
pushed a commit
that referenced
this pull request
Sep 10, 2025
This PR fixes issues with big endian support introduced in the following PRs: - #24295 - The change did not consider the `littleEndianHeap` transform implications, - #24283 - The new LE_HEAP* functions were not added to link.py, causing runtime failure on BE system. The `littleEndianHeap` transform code is simplified and updated to detect the code introduced by `growableHeap` pass. A new test was added to verify the combined transformation generates working code.
inolen
pushed a commit
to inolen/emscripten
that referenced
this pull request
Feb 13, 2026
) This PR fixes issues with big endian support introduced in the following PRs: - emscripten-core#24295 - The change did not consider the `littleEndianHeap` transform implications, - emscripten-core#24283 - The new LE_HEAP* functions were not added to link.py, causing runtime failure on BE system. The `littleEndianHeap` transform code is simplified and updated to detect the code introduced by `growableHeap` pass. A new test was added to verify the combined transformation generates working code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed that acorn-optimizer transforms for ASan, SAFE_HEAP and GROWABLE_HEAP didn't cover the 64-bit integer support enabled by
WASM_BIGINT(HEAP64andHEAPU64memory views).This PR adds demos of failing transforms in one commit, and actual support in the next one so that it's easier to see the diff between incorrectly generated code and the fixed one.
I've only tested on these snapshots for now, so waiting for CI to see if I missed any other tests that need to be updated.